<!--
 * @description: 
 * @Author: Islands
 * @Date: 2024-06-15 00:51:37
 * @LastEditTime: 2024-06-19 00:17:59
-->
<!--
 * @description: 背景图组件
 * @Author: Islands
 * @Date: 2024-06-15 00:51:37
 * @LastEditTime: 2024-06-15 12:28:01
-->
<script lang="ts" setup>
import { props } from "./props";
const { src } = defineProps(props);
</script>
<template>
  <img :src="src" class="bg w-h-100 position-fixed" />
</template>
<style lang="scss" scoped>
.bg {
  z-index: -1;
  /* 背景图垂直、水平均居中 */
  background-position: center center;
  /* 背景图不平铺 */
  background-repeat: no-repeat;
  /* 当内容高度大于图片高度时，背景图像的位置相对于viewport固定 */
  background-attachment: fixed;
  /* 让背景图基于容器大小伸缩 */
  background-size: cover;
  /* 设置背景颜色，背景图加载过程中会显示背景色 */
  background-color: #464646;
}
</style>
